use scopeguard::defer;

use bc_base::constants::SUBSIDY;

use tests::common;

#[tokio::test]
async fn query_balance() {
    let (test_env, tmp_dir) = common::setup("query_balance", false, None, false).await;
    defer! {
        tmp_dir.close().unwrap();
    };

    // do test here
    {
        common::local::prepare_wallet_for_genesis(test_env.bc_manager.clone()).await;
        let bc_manager = test_env.bc_manager.lock().await;
        assert_eq!(bc_manager.query_balance().await, SUBSIDY);
    }

    common::teardown(test_env).await;
}
